<?php foreach ($aryRootCategory as $key => $value) { ?>
    <?php if ($value['category_is_show'] == 1 && isset ($aryProduct[$value['category_id']][0])) { ?>
        <div class="c-parent">
            <div class="c-parent-link c-parent-name">
                <h2><a href="<?php echo $root_page; ?>/danhmuc/<?php echo $value['category_id'];?>/<?php echo $value['category_name_filter'];?>.html" title='<?php echo $value['category_name'];?>'><?php echo $value['category_name'];?></a></h2>
            </div>
            <div class="clear">&nbsp;</div>
        </div>
        <div class="c-sub">
            <?php foreach ($arySubCategory as $keySub => $sub) {?>
                <?php if ($sub['category_is_show'] == 1 && $sub['parent_id'] == $value['category_id']) { ?>
                    <div class="c-sub-list">
                        <a class="c-sub-name" href="<?php echo $root_page;?>/danhmuc/<?php echo $sub['category_id'];?>/<?php echo $sub['category_name_filter'];?>.html" title="<?php echo $sub['category_name'];?>">
                            <?php echo $sub['category_name'];?>
                        </a>
                    </div>
                <?php } ?>
            <?php } ?>
            <div class="clear">&nbsp;</div>
        </div>
    <div class="product-list">
<?php if(isset ($aryProduct[$value['category_id']])){?>
     <?php $i = 1;foreach ($aryProduct[$value['category_id']] as $key3 => $product) { ?>
        <div class="item">
            <div class="box">
                <div class="box-item">
                    <a href="<?php echo $root_page; ?>/sanpham/<?php echo $product['product_id']; ?>/<?php echo $product['product_title_filter']; ?>.html" title="<?php echo $product['product_title']; ?>">
                        <img src="<?php echo $sub_domain['img']; ?>/images/common/blank.gif" data-original="<?php echo $sub_domain['img']; ?>/images/upload/thumbnail/<?php echo $product['product_main_image']; ?>" alt="<?php echo $product['product_title']; ?>" title="<?php echo $product['product_title']; ?>"/>
                    </a>
                <div class="product-name">
                    <a href="<?php echo $root_page; ?>/sanpham/<?php echo $product['product_id']; ?>/<?php echo $product['product_title_filter']; ?>.html" title="<?php echo $product['product_title']; ?>">
                        <?php echo $product['product_title']; ?>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <?php if ($i % 2 == 0) { ?>
        <div class="clear_2"></div>
    <?php } ?>
    <?php if ($i % 3 == 0) { ?>
        <div class="clear_3"></div>
    <?php } ?>
    <?php if ($i % 4 == 0) { ?>
        <div class="clear_4"></div>
    <?php } ?>
    <?php $i++;} ?>
        <div class="clear">&nbsp;</div>
    <?php } ?>
</div>
<?php } ?>
<?php } ?>
